<!-- 适用于EPC/PPP项目 下对应的 表单 -->
<template>
  <div class="mt20">
    <custom-form key="OtherForm2" ref="OtherForm2" :editModel="''" :is-validate="true" :rules="rules" :form="otherform2" :form-list="formOption" @change="handleChange"></custom-form>
  </div>
</template>

<script>
export default {
  name: 'OtherForm2',
  props: {
    form: Object,
    queryInfo: Object
  },
  data() {
    return {
      otherform2: {},
      formOption: [
        {
          label: '深化设计范围',
          keyName: 'designScope',
          type: 'BaseTextarea',
          span: 24,
          placeholder: '请输入，长度不超过300'
        },
        {
          label: '深化设计原则与要求',
          keyName: 'principleRequirement',
          type: 'BaseTextarea',
          span: 24,
          placeholder: '请输入，长度不超过300'
        },
        {
          label: '深化设计单位选择标准',
          keyName: 'selectionCriteria',
          type: 'BaseTextarea',
          span: 24,
          placeholder: '需要选择外部深化设计单位时填写，长度不超过300'
        },
        {
          label: '设计过程控制要点',
          keyName: 'processControl',
          type: 'BaseTextarea',
          span: 24,
          placeholder: '对设计单位的过程控制要求，长度不超过300'
        },
        {
          label: '深化设计进度要求',
          keyName: 'scheduleRequirement',
          type: 'BaseTextarea',
          span: 24,
          placeholder: '请输入，长度不超过300'
        },
        {
          label: '深化设计验收准则与标准',
          keyName: 'criteriaStandard',
          type: 'BaseTextarea',
          span: 24,
          placeholder: '请输入，长度不超过300'
        },
        {
          label: '其他要求',
          keyName: 'otherRequirement',
          type: 'BaseTextarea',
          span: 24,
          placeholder: '请输入，长度不超过300'
        }
      ],
      rules: {
        designScope: [{ required: true, message: '请输入', trigger: 'change' }],
        principleRequirement: [{ required: true, message: '请输入', trigger: 'change' }],
        processControl: [{ required: true, message: '请输入', trigger: 'change' }],
        scheduleRequirement: [{ required: true, message: '请输入', trigger: 'change' }],
        criteriaStandard: [{ required: true, message: '请输入', trigger: 'change' }]
      }
    }
  },

  components: {},

  computed: {},

  watch: {
    'form.planType': {
      handler(val) {
        if (val !== null && val !== undefined) {
          const keys = ['designScope', 'principleRequirement', 'selectionCriteria', 'processControl', 'scheduleRequirement', 'criteriaStandard', 'otherRequirement']
          keys.map((key) => {
            this.$set(this.otherform2, key, this.form[key])
          })
        }
      },
      immediate: true
    },
    queryInfo: {
      handler(val) {
        if (val.pageType == 'detail') {
          this.formOption.map((v) => {
            v.disabled = true
          })
        }
      },
      immediate: true,
      deep: true
    }
  },

  created() {},

  mounted() {},

  methods: {
    handleChange() {}
  }
}
</script>
<style lang='less' scoped>
</style>